package com.ruoyi.order.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.product.domain.ProductSkuVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;

/**
 * 订单项对象 ver_order_item
 *
 * @author ruoyi
 * @date 2025-08-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
public class VerOrderItem extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 订单项ID（主键）
     */
    private Long orderItemId;

    /**
     * 所属订单号（外键，关联 order 表）
     */
    @Excel(name = "所属订单号", readConverterExp = "外=键，关联,o=rder,表=")
    private Long orderId;

    /**
     * 活动ID
     */
    @Excel(name = "活动ID")
    private Long activityId;

    /**
     * 优惠券ID
     */
    @Excel(name = "优惠券ID")
    private Long couponId;

    /**
     * 商品 SKU ID（外键，关联 product_sku 表）
     */
    @Excel(name = "商品 SKU ID", readConverterExp = "外=键，关联,p=roduct_sku,表=")
    private Long itemSkuId;

    /**
     * 维修费类型
     */
    @Excel(name = "维修费类型")
    private Integer protection;

    /**
     * 购买数量
     */
    @Excel(name = "购买数量")
    private Long quantity;

    /**
     * 购买时单价
     */
    @Excel(name = "购买时单价")
    private BigDecimal unitPrice;

    /**
     * SKU表原价
     */
    @Excel(name = "SKU表原价")
    private BigDecimal originalPrice;

    /**
     * 该订单项总金额（数量 × 单价）
     */
    @Excel(name = "该订单项总金额", readConverterExp = "数=量,×=,单=价")
    private BigDecimal totalPrice;

    private List<ProductSkuVo> skus;

    private Integer isReviewed;

}
